<?php
    // product menu
    class ConfigModels
    {
        public function __construct(PDO $pdo) {
            $this->pdo = $pdo;
        }
        public function getAllConfigPage(){
            $sql = "SELECT * FROM set_config";
            $sth = $this->pdo->prepare($sql);
            $sth->execute();
            $result = $sth->fetch();
            return $result;              
        }
        function updateConfigs($arrayCat)
        {
            $sql = "UPDATE set_config 
                    SET NAMESEO_PAGE=?,DESSEO_PAGE=?,KEYWORD_PAGE=?,LOGO_PAGE=?,
                    ADMINMAIL_PAGE=?,FACEBOOK_PAGE=?,YOUTUBE_PAGE=?,GOOGLE_PAGE=?,TWITTER_PAGE=?
            		WHERE id=1";
            $sth = $this->pdo->prepare($sql);
            $result = $sth->execute(array($arrayCat['NAMESEO_PAGE'],$arrayCat['DESSEO_PAGE'],$arrayCat['KEYWORD_PAGE'],
            $arrayCat['LOGO_PAGE'],$arrayCat['ADMINMAIL_PAGE'],$arrayCat['FACEBOOK_PAGE'],$arrayCat['YOUTUBE_PAGE'],
            $arrayCat['GOOGLE_PAGE'],$arrayCat['TWITTER_PAGE']));               
            return true;
        }        
    }